home *** CD-ROM | disk | FTP | other *** search
- /*
- SerialDrvr.h
- © Copyright 1984 Apple Computer Inc. All Rights Reserved
- 1986 Gijs Mos
- 1987 Consulair Corp
- Some values for which IM gives no mnemonics can be obtained if you
- define the symbol SERIAL_ADDITIONS before including this file.
- */
-
- /* Driver reset information - Baud rates */
-
- #define baud300 380
- #define baud600 189
- #define baud1200 94
- #define baud1800 62
- #define baud2400 46
- #define baud3600 30
- #define baud4800 22
- #define baud7200 14
- #define baud9600 10
- #define baud19200 4
- #define baud57600 0
-
- /* Driver reset information - Stop bit selection */
-
- #define stop10 0x4000
- #define stop15 0x8000
- #define stop20 0xC000
-
- /* Driver reset information - Parity bit selection */
-
- #define noParity 0x2000
- #define oddParity 0x1000
- #define evenParity 0x3000
-
- /* Driver reset information - Character size selection */
-
- #define data5 0x0000
- #define data6 0x0400
- #define data7 0x0800
- #define data8 0x0C00
-
- /* Masks for errors */
-
- #define swOverrunErr 1
- #define parityErr 16
- #define hwOverrunErr 32
- #define framingErr 64
-
- /* Masks for changes that cause events to be posted */
-
- #define ctsEvent 32
- #define breakEvent 128
-
- #define xOffWasSent 0x80
-
- /* Result codes */
-
- #ifndef noErr
- #define noErr 0
- #endif
- #ifndef openErr
- #define openErr -23
- #endif
-
- /* Port identifiers */
-
- #define sPortA 0
- #define sPortB 1
-
- /* Control/Status types */
-
- struct SerShk {
- char fXOn;
- char fCTS;
- char xOn;
- char xOff;
- char errs;
- char evts;
- char fInX;
- char null;
- };
-
- typedef struct SerShk SerShk;
-
- struct SerStaRec {
- char cumErrs;
- char xOffSent;
- char rdPend;
- char wrPend;
- char ctsHold;
- char xOffHold
- };
-
- typedef struct SerStaRec SerStaRec;
-
- /* Symbols below aren't mnemonics provided in IM.
- To avoid conflicts they are included conditionally.
- */
-
- #ifdef SERIAL_ADDITIONS
- /* Control function codes */
-
- #define ResetCode 8
- #define SetBufCode 9
- #define HShakeCode 10
- #define ClrBrkCode 11
- #define SetBrkCode 12
- #define BaudRateCode 13
- #define ReplaceCode 19
- #define SetXOffCode 21
- #define ClearXOffCode 22
- #define CSendXOnCode 23
- #define SendXOnCode 24
- #define CSendXOffCode 25
- #define SendXOffCode 26
- #define ResetSSCCode 27
-
- /* Status function codes */
-
- #define GetBufCode 2
- #define ErrFlagCode 8
-
- /* ROM driver names (Cstrings) */
-
- #define aInName ".AIn"
- #define aOutName ".AOut"
- #define bInName ".BIn"
- #define bOutName ".BOut"
-
- /* Driver reference numbers */
-
- #define aInRef -6
- #define aOutRef -7
- #define bInRef -8
- #define bOutRef -9
-
- #endif
-